﻿@using A2.ERP.Models

@{
    List<dynamic> menuHeaders = new List<dynamic>()
    {
        new
        {
            key = 4,
            name = "库存流程",
            icon = "repertory",
            controller = "repertory"
        },
        new
        {
            key = 2,
            name = "库存开单",
            icon = "billing",
            controller = "billing"
        },
        new
        {
            key = 1,
            name = "采购开单",
            icon = "purchase",
            controller = "purchase"
        },
        new
        {
            key = 3,
            name = "仓库管理",
            icon = "store",
            controller = "store"
        },
        new
        {
            key = 0,
            name = "系统设置",
            icon = "setting",
            controller = "setting"
        }
    };

}

<ul class="nav flex-column" id="menu">
    @foreach (var item in menuHeaders)
    {
        <li class="nav-item head-item">
            <a class="nav-link" href="#">
                <i class="icon SkyUI icon-@item.icon" style="font-weight:bold;"></i>
                @item.name
                <i class="icon SkyUI icon-down float-right"></i>
            </a>
            <ul class="nav d-none">
                @foreach (t_Authority childItem in ((List<t_Authority>)ViewBag.MenuData).Where(i => i.TypeID == item.key))
                {
                    <li class="nav-item">
                        <a class="nav-link" data-route="\@(item.controller + "\\" + childItem.ModuleUrl)">
                            <i class="icon SkyUI icon-file"></i>
                            @childItem.AuthorityName
                        </a>
                    </li>
                }
            </ul>
        </li>
    }

</ul>
